All Questions
Tagged with programming-challengehaskell
99 questions
2votes
2answers
129views
Pattern Finding In Lists of Strings (2d Char Array), Advent of Code Day 04 Solution
This is part 2 of Day 4 of 2024's AoC: The problem is as follows: It's an X-MAS puzzle in which you're supposed to find two MAS in the shape of an X. One way to achieve that is like this: ...
2votes
0answers
59views
Last Stone Weight Problem in Haskell Using `fold`
A previous solution of this code has been posted on Code Review before. This solution is more complicated then that one, but more performant (see the below) Why is this another Question instead of a ...
4votes
1answer
186views
Last Stone Weight Problem in Haskell using list `insert`
Background Saw this problem on TheJobOverflow which seems to be a LeetCode question. It bothered me that the "challenge" of this problem was to recognize the need for a specific data-type (...
4votes
1answer
123views
Autocomplete system with prefix tree
I am quite new to Haskell, and this problem is from dailycodingproblem.com: Implement an autocomplete system. That is, given a query string s and a set of all ...
2votes
1answer
148views
Count islands in a binary grid
This is the No of Island code challenge. Please review my implementation in Haskell. I know there must be some better way of doing this. Given an m x n 2D binary grid grid which represents a map of '...
1vote
1answer
92views
Haskell solution to Day 2 problem of Advent of Code '21
I won't restate the problem in full, but in a nutshell you have to parse a file with a "direction" and a "magnitude", for instance: ...
3votes
1answer
146views
Function to sum all Armstrong numbers within a range
I've tried to solve a challenge posted on a LinkedIn forum using Haskell - a language I'm still learning the basics of - and, while the code works correctly, I would like to get some feedback on the ...
2votes
1answer
131views
Advent of Code 2021 Day 4
Here is my attempt at Advent of Code Day 4 using Haskell. A file contains list of number in first line. And subsequent lines have the bingo Cards ...
2votes
1answer
187views
AdventofCode 2021: Day 3 Solution
I am beginner to Haskell. Here is my solution to Advent of Code 2021 Day 3. Let me know what you think. I was looking at the transpose function and decided not to use head & tail function. Given ...
3votes
1answer
268views
Efficiently calculating perfect powers in Haskell
I'm trying to calculate perfect powers to solve this code wars challenge: https://www.codewars.com/kata/55f4e56315a375c1ed000159/haskell The number 81 has a special property, a certain power of the ...
3votes
0answers
196views
Advent of Code 2021, Day 3 in Haskell
This is a working solution to today's Advent of Code puzzle, written in Haskell. However, I feel like this solution is not optimal. ...
6votes
2answers
2kviews
Hamming distance between two strings
I wrote this module to find the Hamming distance between two strings. (It's a problem from exercism.io's Haskell track.) As I saw it, the problem has two distinct ...
2votes
0answers
116views
Partial Function composability in Haskell
Below is my solution for the CTFP chapter 4 challenges which essentially involves composing partial functions (that don't have defined outputs for all possible inputs i.e. returning a Maybe). The ...
1vote
1answer
252views
"Sequence full of colors" challenge on HackerRank
This is the challenge: You are given a sequence of N balls in 4 colors: red, green, yellow and blue. The sequence is full of colors if and only if all of the ...
3votes
0answers
130views
Performance issue regarding Project Euler #60 in Scheme
I solved Project Euler #60: The primes 3, 7, 109, and 673, are quite remarkable. By taking any two primes and concatenating them in any order the result will always be prime. For example, taking 7 ...